package com.jar.exercise.多线程.线程池.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class NewSingleThreadPool {
	public static void main(String[] args) throws InterruptedException {
		ExecutorService executorService = Executors.newSingleThreadExecutor();
		for (int i = 0; i < 10; i++) {
			executorService.execute(() -> System.out.println(Thread.currentThread().getName() + "--->正在运行"));
			Thread.sleep(2000);
		}
	}
}
